#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int main(int argc, char **argv)
{
	int x;
	uint32_t net_addr;

	const char *addr[] = {
		"44.135.86.12",
		"127.0.0.1", 
		"172.16.23.95",
		"192.168.9.1"
	};

	for(x=0; x<4; x++) {
		net_addr = inet_network(addr[x]);
		printf("%14s = 0x%08X net 0x%08X\n", addr[x], net_addr, (unsigned) htonl(net_addr));
		// for inter CPU 
		printf("%14s = 0x%08X net 0x%08X\n", addr[x], net_addr, (unsigned) ntohl((unsigned) htonl(net_addr)));
	}

	return 0;
}
